#!/bin/sh
cd "${0%/*}" || exit                            # Run from this directory
targetType=libso
. "${WM_PROJECT_DIR:?}"/wmake/scripts/AllwmakeParseArguments
#------------------------------------------------------------------------------
# Build into FOAM_USER_{APPBIN,LIBBIN} unless otherwise specified with
# -prefix or FOAM_MODULE_{APPBIN,LIBBIN} env varables
#------------------------------------------------------------------------------
moduleName="external-solver (petsc)"

case "$FOAM_MODULE_PREFIX" in
(false | none)
    echo "Compilation of $moduleName is disabled (prefix=${FOAM_MODULE_PREFIX})"
    exit 0
esac

echo "========================================"
date "+%Y-%m-%d %H:%M:%S %z" 2>/dev/null || echo "date is unknown"
echo "Starting compile of $moduleName with ${WM_PROJECT_DIR##*/}"
echo "  $WM_COMPILER $WM_COMPILER_TYPE compiler"
echo "  ${WM_OPTIONS}, with ${WM_MPLIB} ${FOAM_MPI}"
echo "  prefix = ${FOAM_MODULE_PREFIX:-default (user)}"
echo

src/Allwmake $targetType $*

# Some summary information
echo
date "+%Y-%m-%d %H:%M:%S %z" 2>/dev/null || echo "date is unknown"
echo "========================================"
echo "  Finished compile of $moduleName with ${WM_PROJECT_DIR##*/}"
echo "  $WM_COMPILER $WM_COMPILER_TYPE compiler"
echo "  ${WM_OPTIONS}, with ${WM_MPLIB} ${FOAM_MPI}"
echo

#------------------------------------------------------------------------------
